import VueRouter from 'vue-router';

//导入对应的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MenberContainer from './components/tabbar/MenberContainer.vue'
import shopcarContainer from './components/tabbar/shopcarContainer.vue'
import searchContainer from './components/tabbar/searchContainer.vue'


// /home下的新闻资讯 newpage
import NewPage from './components/news/newpage.vue'
//newpage 下的 每个小分类
import Newinfo from './components/news/Newinfo.vue'

// /home下图片分享
import Pohotolist from './components/photo/pohotolist.vue'
import Pohoinfo from './components/photo/pohoinfo.vue'

//导入 商品列表
import Goodspurchased from './components/goods/goodspurchased.vue'
//导入 商品列表 的详情 页
import GoodsInfo from './components/goods/Goodsinfo.vue'

//商品详细
import GoodsDesc from './components/goods/GoodsDesc.vue'
import GoodsComment from './components/goods/GoodsComment.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    //路由重对象 如果进到根路径是/ 默认会进入到/home中
     {path:'/',redirect:'/home'},
      {path:'/home',component:HomeContainer},
      {path:'/member',component:MenberContainer},
      {path:'/shopcar',component:shopcarContainer},
      {path:'/search',component:searchContainer},
      {path:'/home/newpage',component:NewPage},
      //这是new 中的新闻模块 根据ID 来转换路由
      // {path:'/home/newsinfo/:id',component:Newinfo},
      {path:'/home/newsinfo/1',component:Newinfo},  //这个是模拟数据
      {path:'/home/photoSharing',component:Pohotolist},
      //这是 图片风向中模块 根据Id 来转换路由
      // {path:'/home/photoinfo/:id',component:Pohoinfo}
      {path:'/home/photoinfo/1',component:Pohoinfo}, //这个是模拟数据
      {path:'/home/goodspurchased',component:Goodspurchased},
      // 这是商品购买  api写法
      //添加 name 可以通过 那么来实现路由跳转
      // {path:'/home/goodsinfo:id',component:GoodsInfo,name:'goodinfo},
      {path:'/home/goodsinfo/1',component:GoodsInfo}, //这个是模拟数据
      //商品详细 api
      // {path:'/home/goodsdesc/:id',component:GoodsDesc,name:'goodsdesc'},
      {path:'/home/goodsdesc/1',component:GoodsDesc,name:'goodsdesc'}, //这个是模拟数据
      //商品评价 api
      // {path:'/home/goodscomment/:id',component:GoodsComment,name:'goodscomment'},
      {path:'/home/goodscomment/1',component:GoodsComment,name:'goodscomment'}, //这个是模拟数据
  ],
  linkActiveClass:'mui-active' //覆盖默认的路由高亮度类
})

// 把路由对象暴露出去
export default router